pvh: PV cpuid
authorMukesh Rathor <mukesh.rathor@oracle.com>
Wed, 13 Nov 2013 08:39:13 +0000 (09:39 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 13 Nov 2013 08:39:13 +0000 (09:39 +0100)
NB at the moment we do not handle forced emulated ops.  This means, for example,
that xen-detect will report an HVM Xen guest instead of a PV one.

Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Eddie Dong <eddie.dong@intel.com>
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/traps.c
xen/include/asm-x86/processor.h

index 854f5880467926774c5a13d6b759a3629674ae39..1c91e098af3a0264af13e75e7194ccc517267ec3 100644 (file)
@@ -2766,8 +2766,8 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
         break;
     }
     case EXIT_REASON_CPUID:
+        is_pvh_vcpu(v) ? pv_cpuid(regs) : vmx_do_cpuid(regs);
         update_guest_eip(); /* Safe: CPUID */
-        vmx_do_cpuid(regs);
         break;
     case EXIT_REASON_HLT:
         update_guest_eip(); /* Safe: HLT */
index 26ae7229df16d501cc198aebd37c3cb61f35019c..4b2c2ea8f40f142b62a14ec0326ef2d43538abee 100644 (file)
@@ -719,7 +719,7 @@ int cpuid_hypervisor_leaves( uint32_t idx, uint32_t sub_idx,
     return 1;
 }
 
-static void pv_cpuid(struct cpu_user_regs *regs)
+void pv_cpuid(struct cpu_user_regs *regs)
 {
     uint32_t a, b, c, d;
 
index 893afa3a84135c63e9d17a01435f213fbd1929a3..551036db81fa5f3563118d07893cc2e7bca56dbe 100644 (file)
@@ -567,6 +567,8 @@ void microcode_set_module(unsigned int);
 int microcode_update(XEN_GUEST_HANDLE_PARAM(const_void), unsigned long len);
 int microcode_resume_cpu(int cpu);
 
+void pv_cpuid(struct cpu_user_regs *regs);
+
 #endif /* !__ASSEMBLY__ */
 
 #endif /* __ASM_X86_PROCESSOR_H */